﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using MToolStudio.Render;
using Microsoft.Mtool.FSM;

namespace MToolStudio.UI
{
    public class AddStateTool : UITool
    {
        private StateType stateType = StateType.Free;

        public AddStateTool(FSMDesigner designer, StateType st)
            : base(designer)
        {
            stateType = st;
        }

        public override void OnMouseUp(object sender, MouseEventArgs e)
        {
            e = TransformToLocal(e);
            if (e.Button == MouseButtons.Left)
            {
                Designer.AddState(new Point(e.X, e.Y), stateType);
            }
        }
    }
}